//
// Created by zeng on 2021/10/16.
//

#include "Weather.h"

Weather::Weather(nlohmann::json basicJson, int res_code) : date{basicJson["fxDate"]},
                                                           tempMax{basicJson["tempMax"]},
                                                           tempMin{basicJson["tempMin"]},
                                                           textDay{basicJson["textDay"]},
                                                           textNight{basicJson["textNight"]},
                                                           res_code{res_code} {
    this->
            value = "{'日期':'" + date
                    + "', '白天天气':'" + textDay + "', '夜晚天气':'" + textNight
                    + "', '最高':'" + tempMax + "°C', '" + "最低':'" + tempMin + "°C'}";
}

Weather::Weather(int res_code) : res_code{res_code} {}

std::string Weather::GetValue() {
    return this->value;
}